<nz-row style="margin-bottom: 5px">
  <nz-col nzSpan="5">
    <button nz-button nzType="primary" style="width: 100%">
      输入名称
    </button>
  </nz-col>
  <nz-col nzSpan="19">
    <input nz-input placeholder="请输入名称" [(ngModel)]="param.name" type="text"/>
  </nz-col>
</nz-row>

<nz-row style="margin-bottom: 5px">
  <nz-col nzSpan="5">
    <input type="file" nwdirectory (change)="changeSaveFolder($event)" hidden #saveInput>
    <button nz-button nzType="primary" (click)="saveInput.click()" style="width: 100%">
      选择存档路径
    </button>
  </nz-col>
  <nz-col nzSpan="19">
    <input nz-input placeholder="请输入存档路径" [(ngModel)]="param.saveFolder" type="text"/>
  </nz-col>
</nz-row>

<nz-row style="margin-bottom: 5px">
  <nz-col nzSpan="5">
    <input type="file" nwdirectory (change)="changeBackupFolder($event)" hidden #backupInput>
    <button nz-button nzType="primary" (click)="backupInput.click()" style="width: 100%">
      选择备份路径
    </button>
  </nz-col>
  <nz-col nzSpan="19">
    <input nz-input placeholder="请输入备份路径" [(ngModel)]="param.backupFolder" type="text"/>
  </nz-col>
</nz-row>

<nz-row style="margin-bottom: 5px">
  <nz-col nzSpan="2">
    <button nz-button nzType="primary" (click)="configSave()"
            [disabled]="!param.name||!param.saveFolder||!param.backupFolder">保存
    </button>
  </nz-col>
  <nz-col nzSpan="2">
    <button nz-button nzType="default" (click)="configNew()"
            [disabled]="!param.name||!param.saveFolder||!param.backupFolder">新建
    </button>
  </nz-col>
</nz-row>

<nz-row>
  <nz-col nzSpan="24">
    <nz-table #basicTable [nzData]="list">
      <thead>
      <tr>
        <th>名称</th>
        <th>操作</th>
      </tr>
      </thead>
      <tbody>
      <tr *ngFor="let data of basicTable.data">
        <td>{{data.name}}</td>
        <td>
          <button nz-button nzType="default" (click)="update(data)">修改</button>
          <nz-divider nzType="vertical"></nz-divider>
          <button nz-button nzType="primary" [nzLoading]="(loading$|async)||false" (click)="setDefaultConfig(data)"
                  [disabled]="data.isDefault">
            设为默认
          </button>
          <nz-divider nzType="vertical"></nz-divider>
          <button nz-button nzType="default" (click)="delete(data)">删除</button>
        </td>
      </tr>
      </tbody>
    </nz-table>
  </nz-col>
</nz-row>

